package com.meet.controller;

import com.meet.util.Result;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/location")
@CrossOrigin
public class MeetLocationController {

    @GetMapping("/current")
    public Result<Map<String, Object>> getCurrentLocation() {
        // 这里应该实现定位逻辑，为简化演示直接返回示例数据
        Map<String, Object> data = new HashMap<>();
        Map<String, Object> location = new HashMap<>();
        location.put("name", "北京市朝阳区");
        location.put("address", "北京市朝阳区某某街道123号");
        location.put("latitude", 39.9042);
        location.put("longitude", 116.4074);
        data.put("location", location);
        data.put("status", "located");
        return Result.success(data);
    }

}
